package com.abe.jmcl.api;

import com.abe.jmcl.api.service.WeManagerService;
import com.abe.jmcl.api.service.XmlCitiesService;
import com.abeframe.core.base.http.BaseApi;

public class AppMainService {
    private static XmlCitiesService xmlCitiesService;
    private static WeManagerService weManagerService;

    //重选地址的初始化
    public static void initService() {
        xmlCitiesService = null;
        weManagerService = null;
    }

    public static XmlCitiesService getXmlCitiesService() {
        if (xmlCitiesService == null) {
            xmlCitiesService = BaseApi.retrofitXml(Api.XmlCities).create(XmlCitiesService.class);
        }
        return xmlCitiesService;
    }

    public static WeManagerService getWeManagerService() {
        if (weManagerService == null) {
            weManagerService = BaseApi.retrofit(Api.WeManager).create(WeManagerService.class);
        }
        return weManagerService;
    }
}
